<link rel="stylesheet" href="__PUBLIC__/static/editor.md/css/editormd.min.css" />
<div id="editormd">
    <textarea style="display:none;" name="{$name}" id="{$id}">{$default}</textarea>
</div>
<script src="__PUBLIC__/static/editor.md/editormd.min.js"></script>
<script type="text/javascript">
    $(function() {
        var editor = editormd("editormd", {
        {$config}
            ,onfullscreen : function() {
                $('#editormd').css('z-index', '20000') ;
                if($('[data-role="left-sidebar"]').length > 0){
                    $('[data-role="left-sidebar"]').removeClass("main-sidebar") ;
                    $('[data-role="top-sidebar"]').css('z-index', '99') ;
                }
            },
            onfullscreenExit : function() {
                if($('[data-role="left-sidebar"]').length > 0){
                    $('[data-role="left-sidebar"]').addClass("main-sidebar") ;
                    $('[data-role="top-sidebar"]').css('z-index', '') ;
                }
            },
            saveHTMLToTextarea : true,
        });
        $('.editormd-preview-close-btn').css('display', 'none') ;
    });
</script>